package cn.ihna.test.jardemo;

import cn.ihna.test.jardemo.intro.MyIntroClass;
import lombok.extern.slf4j.Slf4j;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.context.ConfigurableApplicationContext;

@SpringBootApplication
@Slf4j
public class JarDemoApplication {

    public static void main(String[] args) {
        ConfigurableApplicationContext applicationContext = SpringApplication.run(JarDemoApplication.class, args);
        MyIntroClass bean = applicationContext.getBean(MyIntroClass.class);
        try {
            bean.start();
        } catch (Exception e) {
            log.error("main method", e);
        } finally {
            SpringApplication.exit(applicationContext);
        }
    }

}
